package com.arcaneshift.security.exceptions;

import com.common.security.abstracts.AbstractRuntimeException;

/*
 * @Latest
 * Error code range: 1201 - 1220
 * 
 */
public class DeckException extends AbstractRuntimeException {
	private static final long serialVersionUID = 1L;

	public static final int DECK_NOT_FOUND = 1201;
	private static final String MESSAGE_DECK_NOT_FOUND = "The deck with the provided data was not found";
	
	public static final int MULTIPLE_DECKS_FOUND = 1282;
	private static final String MESSAGE_MULTIPLE_DECKS_FOUND = "More then one deck was found with the provided data";
	
	public static final int DECK_EXISTS = 1283;
	private static final String MESSAGE_DECK_EXISTS = "A deck with the provided data was found in the system";
	
	public DeckException(int code) {
		super(code, getMessage(code));
	}
	
	private static String getMessage(int code) {
		switch (code) {
			case DECK_NOT_FOUND: {
				return MESSAGE_DECK_NOT_FOUND;
			}
			case MULTIPLE_DECKS_FOUND: {
				return MESSAGE_MULTIPLE_DECKS_FOUND;
			}
			case DECK_EXISTS: {
				return MESSAGE_DECK_EXISTS;
			}
			default: {
				return MESSAGE_ERROR_NOT_FOUND;
			}
		}
	}
}
